SPB Git forge
38commits 1branches 0releases
338.7 MBsize
maindefault branch
7 h agolast push
HTML 53.9% TypeScript 44.5% JavaScript 0.6% SQL 0.5%
577 B · 12 lines typescript
Raw Blame History
1import type { FacilityDetail } from "@dci/core";2import { cache } from "react";3import { api, type ApiResult } from "@/lib/api";45/** Per-request memoised facility loader shared by layout (existence check), metadata, page and OG image. */6export const getFacility = cache(async (slug: string): Promise<ApiResult<FacilityDetail>> => api.facility(slug));78/** The API returns `mwIsEstimate` (not yet in the shared contract). */9export function mwIsEstimate(f: FacilityDetail): boolean {10  return Boolean((f as FacilityDetail & { mwIsEstimate?: boolean | null }).mwIsEstimate);11}12